package com.example.transactiondemo.spring;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.sql.SQLException;

@Repository
public class UserDao {

    @Autowired
    JdbcTemplate jdbcTemplate;

    void insertUserInfo(User user) throws SQLException {
        jdbcTemplate.update("insert into user_tb(id, uname, gender) values(?, ?, ?)", user.getId(), user.getUname(), user.getGender());
    }
}
